<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="..//js/vue.js"></script>
    <style>
        .static {
            width: 100px;
            height: 100px;
            line-height: 100px;
            text-align: center;
            font-size: 36px;
        }

        .a {
            background: pink;
        }

        .b {
            border: 4px solid blue;
        }

        .c {
            border-radius: 50%;
            box-shadow: 0 0 4px 4px #999;
        }
    </style>
</head>

<body>
    <div id="app">
        <h2>{{title}}</h2>
        <div>
            <div class="static a b c">1</div>
            <div class="static" :class="active">2</div>
            <div class="static" :class="'c'">3</div>
            <div class="static" @click="flag=!flag" :class="flag?'a':'c'">4</div>
            <div class="static" :class="{b:isB,c:isC}">5</div>
            <div class="static" :class="[isa,isb]">6</div>
            <h2>style - 内联样式 </h2>
            <div class="static" style="background: red;color:aquamarine;">7</div>
            <div class="static" :style="{background:'red',color:'pink',borderRadius:'50%'}">8</div>
            <div class="static" :style="styleobj">9</div>
        </div>
    </div>

    <script>
        const vm = new Vue({
            data: {
                title: 'vue style 和 class 的绑定 ',
                active: 'a b',
                flag: true,
                isB: true,
                isC: false,
                isa: 'a',
                isb: 'b',
                styleobj: {
                    background: 'red',
                    color: 'yellow',
                    fontSize: '100px',
                    borderRadius: "50%"
                },
            }
        }).$mount('#app')


    </script>
     <!-- 
        动态的class 和  style 切换   
    v-bind 用于 class 和 style 时，Vue.js 做了专门的增强   除了字符串之外，还可以是对象或数组

    v-bind
    v-bind:class 
    :class = " "  {}  []
    v-bind:style 
    :style = {}  [{}]

    :style="{display:current==i?'block':'none'} -->
</body>

</html>